#include<iostream>
#include<sstream>
#include<thread>

#include "tools.h"
#include "string.h"
#include "package.h"
#include "ip.h"

#define RANGES_PATH  "ranges/"

using namespace dounine_package;
using namespace dounine_tools;
using namespace dounine_string;
using namespace dounine_ip;

using namespace std;

#define SYN_TIMEOUT 2 //send syn package timeout
#define SYN_PORT 80   //scan port

int main(int argc, char *argv[]){

	ostringstream io;
	io<<RANGES_PATH<<"China.txt";
	string filename = io.str();

	vector<string> ips = dounine_tools::read_file(filename);

	thread *captcha = new thread(dounine_package::read_syn_ack);
	char source_ip[20];
	dounine_package::get_local_ip( source_ip );

	for(int i =0,size = ips.size();i<=size;++i){
		dounine_ip::spl_ip(ips[i],source_ip);
	}

	captcha->join();

	return 0;
}

